<?php

namespace App\Console\Commands;

use App\Scrapers\GoodsTrans;
use App\Scrapers\ZwdScraper;
use Illuminate\Console\Command;

class Test extends Command
{
    /**
     * The name and signature of the console command.
     *
     * @var string
     */
    protected $signature = 'test';

    /**
     * The console command description.
     *
     * @var string
     */
    protected $description = 'Command description';

    /**
     * Create a new command instance.
     *
     * @return void
     */
    public function __construct()
    {
        parent::__construct();
    }

    /**
     * Execute the console command.
     *
     * @return int
     */
    public function handle()
    {
        $url = "https://gz.17zwd.com/item.htm?GID=116576614&spm=3485a93c151bfd98.42.140.0.0.145630.0";
        $scraper = new ZwdScraper();
        $params = $scraper->getGoodsParams($url);
        $goods_trans = new GoodsTrans();
        $params = $goods_trans->translate($params);
        $scraper->dd($params);
        return 0;
    }
}
